using UnityEngine;
using System.Collections;

public class ControlHistoria : MonoBehaviour {
	
	public GUITexture h1;
	public GUITexture h2;
	public GUITexture h3;
	public GUITexture h4;
	public GUITexture h5;
	public GUITexture h6;
	public GUITexture h7;
	public GUITexture h8;
	public GUITexture h9;
	public GUITexture hfinal;
	
	private int control;
	// Use this for initialization
	void Start () {
	
		h1.enabled=false;
		h2.enabled=false;
		h3.enabled=false;
		h4.enabled=false;
		h5.enabled=false;
		h6.enabled=false;
		h7.enabled=false;
		h8.enabled=false;
		h9.enabled=false;
		hfinal.enabled=false;
		control=0;
	}
	
	// Update is called once per frame
	void Update () {
	
	if( Input.GetKeyUp(KeyCode.Space)) {
			control++;
			if(control<=9){
				if(control==1){
					h1.enabled=true;
				}
				else if(control==2){
					h1.enabled=false;
					h2.enabled=true;
				}
				else if(control==3){
					h2.enabled=false;
					h3.enabled=true;
				}
				else if(control==4){
					h3.enabled=false;
					h4.enabled=true;
				}
				else if(control==5){
					h4.enabled=false;
					h5.enabled=true;
				}
				else if(control==6){
					h5.enabled=false;
					h6.enabled=true;
				}
				else if(control==7){
					h6.enabled=false;
					h7.enabled=true;
				}
				else if(control==8){
					h7.enabled=false;
					h8.enabled=true;
				}		
				else if(control==9){
					h8.enabled=false;
					h9.enabled=true;
				}					
			}
			else if(control==10){
				h9.enabled=false;
				hfinal.enabled=true;
			}
			else{
				Application.LoadLevel(3);
			}
		}
}
}